﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="FileInformationPageViewModel.cs" company="Microsoft">
//   Microsoft
// </copyright>
// <summary>
//   Defines the ConfigureInstancePageViewModel type.
// </summary>
// Copyright (c) Microsoft Corporation. All rights reserved.
// 
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
// ----------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
// --------------------------------------------------------------------------------------------------------------------

namespace MySemanticSearch.ViewModel
{
    using System.ComponentModel;

    using MySemanticSearch.Web.Model;

    /// <summary>
    /// ViewModel for the FileInformation Dialog
    /// </summary>
    public class FileInformationPageViewModel : INotifyPropertyChanged
    {
        /// <summary>
        /// Document to show
        /// </summary>
        private Document document;

        /// <summary>
        /// Initializes a new instance of the <see cref="FileInformationPageViewModel"/> class.
        /// </summary>
        /// <param name="document">
        /// The document.
        /// </param>
        public FileInformationPageViewModel(Document document)
        {
            this.Document = document;
        }

        /// <summary>
        /// PropertyChanged event handler
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Gets or sets document.
        /// </summary>
        public Document Document
        {
            get
            {
                return this.document;
            }

            set
            {
                this.document = value;
                this.NotifyPropertyChanged("Document");
            }
        }

        #region Notify Property Changed
        /// <summary>
        /// Notify property Changed
        /// </summary>
        /// <param name="info">
        /// The info string.
        /// </param>
        private void NotifyPropertyChanged(string info)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }
        #endregion
    }
}
